`
https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
`

/**
 * @param {number[]} prices
 * @param {number} fee
 * @return {number}
 */
var maxProfit = function (prices, fee) {
  const n = prices.length
  let dp_0 = 0, dp_1 = -Infinity

  for (let i = 0; i < n; i++) {
    // 休息或卖出
    dp_0 = Math.max(dp_0, dp_1 + prices[i])
    // 休息或买入
    dp_1 = Math.max(dp_1, dp_0 - prices[i] - fee)
  }

  return dp_0
};